<template>

  <a-tabs default-active-key="1" >
    <a-tab-pane v-for="pane in panes" :key="pane.item_value" :tab="pane.item_text" >
      <assessment-projects-classification-list :project_type="pane.item_value" ></assessment-projects-classification-list>

    </a-tab-pane>
  </a-tabs>
</template>

<script>
import TeacherResultDetail from '@views/gfxy/result/teacherResultDetail'
import { getCurrentDate } from '@api/api'
import store from '@/store'
import Vue from 'vue'
import { CURRENT_DATE, USER_INFO, USER_ROLES } from '@/store/mutation-types'
import { getAction } from '@api/manage'
import TeacherYearAssessmentResult
  from '@views/dashboard/gfxy/assessmentResult/yearAssessment/TeacherYearAssessmentResult.vue'
export default {
  name: 'IndexTeacher',
  components: { TeacherYearAssessmentResult, TeacherResultDetail },
  props: {
    userName: {
      type: String,
      required: true
    },
    queryDate: {
      type: String,
      required: true
    }
  },
  created() {
    // this.initCurrent();
    this.currentDate = Vue.ls.get(CURRENT_DATE);
  },
  data(){
    return {
      loading : false,
      inited: false,
      teacherCount:{},
      currentDate:'',
      teacherBaseInfo:{},
      url:{
        getTeacherScoreUrl:'index/teacherIndex/getTeacherScoreAndRankedByUsernameAndDate',
        getTeacherBaseInfoUrl:'index/teacherIndex/getTeacherBaseInfoByUserName'
      }
    }
  },
  methods:{
    init(username){
      this.loading = true;
      getAction(this.url.getTeacherBaseInfoUrl, { username: username }).then((res) => {
        if (res.success) {
          if(res.result.length == 1){
            this.teacherBaseInfo = res.result[0];
            console.log("teacherBaseInfo:", this.teacherBaseInfo);
          } else {
            this.$message.warning(res.message);
          }
        }
        // this.inited = true;
      }).finally(() => {
        this.loading = false;
      })
    },
  },
  mounted() {
    // let roles = Vue.ls.get(USER_ROLES);
    this.init(this.userName);
  }
}
</script>

<style lang="less" scoped>

</style>